package com.chapter4.lianxi.demo3;

public class CalculateAmount {
    public void calculateAmount(PhoneCard phoneCard){
        double v = phoneCard.getInitMoney() - phoneCard.getTime() *
                phoneCard.getMinMoney();
        System.out.println("剩余金额：" + v);
    }

    public static void main(String[] args) {
        IpCard ipCard = new IpCard("ip123456");
        TwoZeroOneCard twoZeroOneCard = new TwoZeroOneCard("tzo123456");

        CalculateAmount calculateAmount = new CalculateAmount();

        calculateAmount.calculateAmount(ipCard);
        calculateAmount.calculateAmount(twoZeroOneCard);

    }
}
